#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py

import os, time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

#远程调试
chrome_options = Options()
chrome_options.add_experimental_option("debuggerAddress", "127.0.0.1:9222")

driver = webdriver.Chrome(options=chrome_options)
file_path = os.path.join('file:///', os.getcwd(), "selenium.html")


# 打开html文件
driver.get(file_path)
sign_form = driver.find_element_by_css_selector('div#signup form')
file_ele = driver.find_element_by_css_selector(
    'div#signup input[name="upload"]')
file_ele.send_keys(file_path)
time.sleep(10)
sign_form.submit()
